import http from '../utils/request'
export const getRoleList = (params) => {
    return http.get('/roles', params)
}

export const getInit = () => {
    return http.get('/roles/params')
}

export const addRole = (data) => {
    return http.post('/roles', data)
}

export const editRole = (role, data) => {
    return http.put(`/roles/${role}`, data)
}

export const deleteRole = (role) => {
    return http.delete(`/roles/${role}`)
}

export const assignPermissions = (role, data) => {
    return http.post(`/roles/${role}/permissions`, data)
}

export const assignMenus = (role, data) => {
    return http.post(`/roles/${role}/menus`, data)
}
